<?php

/**
 * SplFileObject类为文件提供了一个面向对象接口.
 *  继承了SplFileInfo类.
 * Class SplFileObject
 */
class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator {
	const DROP_NEW_LINE = 1;
	const READ_AHEAD = 2;
	const SKIP_EMPTY = 6;
	const READ_CSV = 8;


	/**
	 * Construct a new file object.
	 * @param $file_name
	 * @param $open_mode 文件打开模式，参考: http://php.net/manual/zh/function.fopen.php
	 * @param $use_include_path [optional]
	 * @param $context [optional]
	 */
	public function __construct ($file_name, $open_mode, $use_include_path, $context) {}

	/**
	 * Rewind the file to the first line
	 * @link http://php.net/manual/en/splfileobject.rewind.php
	 * @return void
	 * @since 5.1.0
	 */
	public function rewind () {}

	/**
	 * Reached end of file
	 * @link http://php.net/manual/en/splfileobject.eof.php
	 * @return bool true if file is at EOF, false otherwise.
	 * @since 5.1.0
	 */
	public function eof () {}

	/**
	 * Not at EOF
	 * @link http://php.net/manual/en/splfileobject.valid.php
	 * @return bool true if not reached EOF, false otherwise.
	 * @since 5.1.0
	 */
	public function valid () {}

	/**
	 * Gets line from file
	 * @link http://php.net/manual/en/splfileobject.fgets.php
	 * @return string a string containing the next line from the file, or false on error.
	 * @since 5.1.0
	 */
	public function fgets () {}

	/**
	 * Read from file
	 * @link http://php.net/manual/en/splfileobject.fread.php
	 * @param int $length <p>
	 * The number of bytes to read.
	 * </p>
	 * @return string returns the string read from the file or FALSE on failure.
	 * @since 5.5.11
	 */
	public function fread ($length) {}

	/**
	 * Gets line from file and parse as CSV fields
	 * @link http://php.net/manual/en/splfileobject.fgetcsv.php
	 * @param string $delimiter [optional] <p>
	 * The field delimiter (one character only). Defaults as a comma or the value set using <b>SplFileObject::setCsvControl</b>.
	 * </p>
	 * @param string $enclosure [optional] <p>
	 * The field enclosure character (one character only). Defaults as a double quotation mark or the value set using <b>SplFileObject::setCsvControl</b>.
	 * </p>
	 * @param string $escape [optional] <p>
	 * The escape character (one character only). Defaults as a backslash (\) or the value set using <b>SplFileObject::setCsvControl</b>.
	 * </p>
	 * @return array an indexed array containing the fields read, or false on error.
	 * </p>
	 * <p>
	 * A blank line in a CSV file will be returned as an array
	 * comprising a single null field unless using <b>SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE</b>,
	 * in which case empty lines are skipped.
	 * @since 5.1.0
	 */
	public function fgetcsv ($delimiter = ",", $enclosure = "\"", $escape = "\\") {}

	/**
	 * Write a field array as a CSV line
	 * @link http://php.net/manual/en/splfileobject.fputcsv.php
	 * @param array $fields <p>
	 * An array of values
	 * @param string $delimiter [optional] <p>
	 * The field delimiter (one character only). Defaults as a comma or the value set using <b>SplFileObject::setCsvControl</b>.
	 * </p>
	 * @param string $enclosure [optional] <p>
	 * The field enclosure character (one character only). Defaults as a double quotation mark or the value set using <b>SplFileObject::setCsvControl</b>.
	 * </p>
	 * @param string $escape_char The optional escape_char parameter sets the escape character (one character only).
	 * @return int Returns the length of the written string or FALSE on failure.
	 * @since 5.4.0
	 *</p>
	 */
	public function fputcsv (array $fields, $delimiter = ',' , $enclosure = '"', $escape_char = "\\") {}

	/**
	 * Set the delimiter and enclosure character for CSV
	 * @link http://php.net/manual/en/splfileobject.setcsvcontrol.php
	 * @param string $delimiter [optional] <p>
	 * The field delimiter (one character only).
	 * </p>
	 * @param string $enclosure [optional] <p>
	 * The field enclosure character (one character only).
	 * </p>
	 * @param string $escape [optional] <p>
	 * The field escape character (one character only).
	 * </p>
	 * @return void
	 * @since 5.2.0
	 */
	public function setCsvControl ($delimiter = ",", $enclosure = "\"", $escape = "\\") {}

	/**
	 * Get the delimiter and enclosure character for CSV
	 * @link http://php.net/manual/en/splfileobject.getcsvcontrol.php
	 * @return array an indexed array containing the delimiter and enclosure character.
	 * @since 5.2.0
	 */
	public function getCsvControl () {}

	/**
	 * Portable file locking
	 * @link http://php.net/manual/en/splfileobject.flock.php
	 * @param int $operation <p>
	 * <i>operation</i> is one of the following:
	 * <b>LOCK_SH</b> to acquire a shared lock (reader).
	 * @param int $wouldblock [optional] <p>
	 * Set to true if the lock would block (EWOULDBLOCK errno condition).
	 * </p>
	 * @return bool true on success or false on failure.
	 * @since 5.1.0
	 */
	public function flock ($operation, &$wouldblock = null) {}

	/**
	 * Flushes the output to the file
	 * @link http://php.net/manual/en/splfileobject.fflush.php
	 * @return bool true on success or false on failure.
	 * @since 5.1.0
	 */
	public function fflush () {}

	/**
	 * Return current file position
	 * @link http://php.net/manual/en/splfileobject.ftell.php
	 * @return int the position of the file pointer as an integer, or false on error.
	 * @since 5.1.0
	 */
	public function ftell () {}

	/**
	 * Seek to a position
	 * @link http://php.net/manual/en/splfileobject.fseek.php
	 * @param int $offset <p>
	 * The offset. A negative value can be used to move backwards through the file which
	 * is useful when SEEK_END is used as the <i>whence</i> value.
	 * </p>
	 * @param int $whence [optional] <p>
	 * <i>whence</i> values are:
	 * <b>SEEK_SET</b> - Set position equal to <i>offset</i> bytes.
	 * <b>SEEK_CUR</b> - Set position to current location plus <i>offset</i>.
	 * <b>SEEK_END</b> - Set position to end-of-file plus <i>offset</i>.
	 * </p>
	 * <p>
	 * If <i>whence</i> is not specified, it is assumed to be <b>SEEK_SET</b>.
	 * </p>
	 * @return int 0 if the seek was successful, -1 otherwise. Note that seeking
	 * past EOF is not considered an error.
	 * @since 5.1.0
	 */
	public function fseek ($offset, $whence = SEEK_SET) {}

	/**
	 * Gets character from file
	 * @link http://php.net/manual/en/splfileobject.fgetc.php
	 * @return string a string containing a single character read from the file or false on EOF.
	 * @since 5.1.0
	 */
	public function fgetc () {}

	/**
	 * Output all remaining data on a file pointer
	 * @link http://php.net/manual/en/splfileobject.fpassthru.php
	 * @return int the number of characters read from <i>handle</i>
	 * and passed through to the output.
	 * @since 5.1.0
	 */
	public function fpassthru () {}

	/**
	 * Gets line from file and strip HTML tags
	 * @link http://php.net/manual/en/splfileobject.fgetss.php
	 * @param string $allowable_tags [optional] <p>
	 * You can use the optional third parameter to specify tags which should
	 * not be stripped.
	 * </p>
	 * @return string a string containing the next line of the file with HTML and PHP
	 * code stripped, or false on error.
	 * @since 5.1.0
	 */
	public function fgetss ($allowable_tags = null) {}

	/**
	 * Parses input from file according to a format
	 * @link http://php.net/manual/en/splfileobject.fscanf.php
	 * @param string $format <p>
	 * The specified format as described in the <b>sprintf</b> documentation.
	 * </p>
	 * @param mixed $_ [optional] <p>
	 * The optional assigned values.
	 * </p>
	 * @return mixed If only one parameter is passed to this method, the values parsed will be
	 * returned as an array. Otherwise, if optional parameters are passed, the
	 * function will return the number of assigned values. The optional
	 * parameters must be passed by reference.
	 * @since 5.1.0
	 */
	public function fscanf ($format, &$_ = null) {}

	/**
	 * Write to file
	 * @link http://php.net/manual/en/splfileobject.fwrite.php
	 * @param string $str <p>
	 * The string to be written to the file.
	 * </p>
	 * @param int $length [optional] <p>
	 * If the <i>length</i> argument is given, writing will
	 * stop after <i>length</i> bytes have been written or
	 * the end of <i>string</i> is reached, whichever comes
	 * first.
	 * </p>
	 * @return int the number of bytes written, or null on error.
	 * @since 5.1.0
	 */
	public function fwrite ($str, $length = null) {}

	/**
	 * Gets information about the file
	 * @link http://php.net/manual/en/splfileobject.fstat.php
	 * @return array an array with the statistics of the file; the format of the array
	 * is described in detail on the <b>stat</b> manual page.
	 * @since 5.1.0
	 */
	public function fstat () {}

	/**
	 * Truncates the file to a given length
	 * @link http://php.net/manual/en/splfileobject.ftruncate.php
	 * @param int $size <p>
	 * The size to truncate to.
	 * </p>
	 * <p>
	 * If <i>size</i> is larger than the file it is extended with null bytes.
	 * </p>
	 * <p>
	 * If <i>size</i> is smaller than the file, the extra data will be lost.
	 * </p>
	 * @return bool true on success or false on failure.
	 * @since 5.1.0
	 */
	public function ftruncate ($size) {}

	/**
	 * Retrieve current line of file
	 * @link http://php.net/manual/en/splfileobject.current.php
	 * @return string|array Retrieves the current line of the file. If the <b>SplFileObject::READ_CSV</b> flag is set, this method returns an array containing the current line parsed as CSV data.
	 * @since 5.1.0
	 */
	public function current () {}

	/**
	 * Get line number
	 * @link http://php.net/manual/en/splfileobject.key.php
	 * @return int the current line number.
	 * @since 5.1.0
	 */
	public function key () {}

	/**
	 * Read next line
	 * @link http://php.net/manual/en/splfileobject.next.php
	 * @return void
	 * @since 5.1.0
	 */
	public function next () {}

	/**
	 * Sets flags for the SplFileObject
	 * @link http://php.net/manual/en/splfileobject.setflags.php
	 * @param int $flags <p>
	 * Bit mask of the flags to set. See
	 * SplFileObject constants
	 * for the available flags.
	 * </p>
	 * @return void
	 * @since 5.1.0
	 */
	public function setFlags ($flags) {}

	/**
	 * Gets flags for the SplFileObject
	 * @link http://php.net/manual/en/splfileobject.getflags.php
	 * @return int an integer representing the flags.
	 * @since 5.1.0
	 */
	public function getFlags () {}

	/**
	 * Set maximum line length
	 * @link http://php.net/manual/en/splfileobject.setmaxlinelen.php
	 * @param int $max_len <p>
	 * The maximum length of a line.
	 * </p>
	 * @return void
	 * @since 5.1.0
	 */
	public function setMaxLineLen ($max_len) {}

	/**
	 * Get maximum line length
	 * @link http://php.net/manual/en/splfileobject.getmaxlinelen.php
	 * @return int the maximum line length if one has been set with
	 * <b>SplFileObject::setMaxLineLen</b>, default is 0.
	 * @since 5.1.0
	 */
	public function getMaxLineLen () {}

	/**
	 * SplFileObject does not have children
	 * @link http://php.net/manual/en/splfileobject.haschildren.php
	 * @return bool false
	 * @since 5.1.2
	 */
	public function hasChildren () {}

	/**
	 * No purpose
	 * @link http://php.net/manual/en/splfileobject.getchildren.php
	 * @return null An SplFileObject does not have children so this method returns NULL.
	 * @since 5.1.0
	 */
	public function getChildren () {}

	/**
	 * Seek to specified line
	 * @link http://php.net/manual/en/splfileobject.seek.php
	 * @param int $line_pos <p>
	 * The zero-based line number to seek to.
	 * </p>
	 * @return void
	 * @since 5.1.0
	 */
	public function seek ($line_pos) {}

	/**
	 * Alias of <b>SplFileObject::fgets</b>
	 * @link http://php.net/manual/en/splfileobject.getcurrentline.php
	 * @return string Returns a string containing the next line from the file, or FALSE on error.
	 * @since 5.1.2
	 */
	public function getCurrentLine () {}

	/**
	 * Alias of <b>SplFileObject::current</b>
	 * @link http://php.net/manual/en/splfileobject.tostring.php
	 * @since 5.1.0
	 */
	public function __toString () {}
}